package com.wfk.enums;

import java.util.ArrayList;
import java.util.List;

import com.wfk.utils.ValidateUtil;


public enum PayEnums {
	alpay(1,"支付宝"),
	wxpay(2,"微信"),
	moneypay(3,"余额"),
	bankpay(4,"银联");
	private Integer id;
	 
    private String name;

    public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
 
	private PayEnums(Integer id,String name){
		this.id=id;
		this.name=name;
	}
	
	public static List<PayEnums> queryList(){
		List<PayEnums> list=new ArrayList<PayEnums>();
		for(PayEnums o:PayEnums.values()){
			list.add(o);
		}
		return list;
	}
	
	public static String getName(Integer id){
		String str="";
		for(PayEnums o:PayEnums.values()){
			if(ValidateUtil.isEquals(id, o.getId())){
				str= o.getName();
				break;
			}
		}
		return str;
	}
}
